package com.zlll.winner.controller.common;

import com.zlll.winner.business.service.area.IAreaCityService;
import com.zlll.winner.business.vo.area.CityTree;
import com.zlll.winner.common.BaseController;
import com.zlll.winner.common.BaseResult;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * 获取城市信息
 */
@RestController
@RequestMapping(value = "/common/city")
public class CityController extends BaseController {

    @Reference
    private IAreaCityService iAreaCityService;

    /**
     * 获取城市树
     * @return
     */
    @GetMapping(value = "/city-tree")
    public BaseResult getProjectTree(){
        BaseResult result = new BaseResult();
        List<CityTree> list = iAreaCityService.getCityListTree();
        result.setData(list);
        return result;
    }
}
